Skip to content

Deprecate array_first/array_last helpers in favor of Arr::first/Arr::last - #24

Merged
agissept merged 3 commits into
masterfrom
deprecate-array-first-last
Jul 31, 2026
Merged

Deprecate array_first/array_last helpers in favor of Arr::first/Arr::last#24
agissept merged 3 commits into
masterfrom
deprecate-array-first-last

Conversation

@agissept

Copy link
Copy Markdown
Member

Summary

  • Replace all internal usages of array_first()/array_last() with Arr::first()/Arr::last()
  • Keep the helper functions available but mark them @deprecated
  • Add use Illuminate\Support\Arr; imports where missing

Tests in tests/Support/SupportHelpersTest.php intentionally still call the deprecated helpers to verify they keep working.

Test plan

  • Full test suite passes: 1619 tests OK (same as master)

🤖 Generated with Claude Code

agissept and others added 2 commits July 21, 2026 17:36
…irst/Arr::last

Replace all internal usages with Arr::first/Arr::last. The helper
functions remain available but are marked @deprecated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PHP 8.5 deprecates using null as an array offset. $namespace is null
for non-namespaced config keys, so guard the afterLoad lookup.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@agissept
agissept force-pushed the deprecate-array-first-last branch from f8bc664 to eb7c898 Compare July 21, 2026 10:36
PHP 8.5 deprecates using null as an array offset. groupBy's key can
resolve to null (closure or data_get returning null), so coalesce to
an empty string.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@agissept
agissept merged commit e7db142 into master Jul 31, 2026
2 checks passed
@agissept
agissept deleted the deprecate-array-first-last branch July 31, 2026 06:47
@agissept
agissept restored the deprecate-array-first-last branch July 31, 2026 06:53
@agissept
agissept deleted the deprecate-array-first-last branch July 31, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant